
#ifndef _MEMBER_BMENU_H_
#define _MEMBER_BMENU_H_

#include <BRect>
#include <BStyle>
#include <BIcon>
#include <BLayout>
#include <BImage>
#include "IMenuItem.h"

#define menu_member(menu)		((member_BMenu*)((BMenu*)menu)->_ptr)

namespace BWE
{
	class member_BMenu : public BObject
	{
		friend class BMenu;
	public:
		member_BMenu(BMenu* menu);
		~member_BMenu();

		void raiseSignal(int signal, const BValue& value = BValue());

		BMenu* locateMenu(const BString& path, BString& temp);

		void freshRects();
		
		void slotActionRenamed(BObject* object, const BValue& value);
		void slotActionEnabled(BObject* object, const BValue& value);
		void slotActionIconChanged(BObject* object, const BValue& value);
		void slotActionTextChanged(BObject* object, const BValue& value);
		void slotActionChecked(BObject* object, const BValue& value);
		void slotActionTriggered(BObject* object, const BValue& value);
		void slotActionVisibleChanged(BObject* object, const BValue& value);

		void slotMenuEnabled(BObject* object, const BValue& value);
		void slotMenuRenamed(BObject* object, const BValue& value);
		void slotMenuStyled(BObject* object, const BValue& value);
		void slotMenuIconChanged(BObject* object, const BValue& value);
		void slotMenuTitleChanged(BObject* object, const BValue& value);
		void slotMenuVisibleChanged(BObject* object, const BValue& value);

		BMenu*				boss;
		Form				form;
		Align				align;
		int					spacing;
		Orientation			orientation;
		BPoint				offset;
		BSize				iconSize;
		BSize				arrowSize;
		Align				arrowAlign;
		Graph				arrowGraph;
		BIconHolder			arrowIcon;
		BSize				separatorSize;
		BImageHolder		separatorImage;
		const BStyle*		separatorStyle;
		bool				shortcutVisible;
		int					shortcutSpacing;
		const BStyle*		shortcutStyle;

		bool				dirty;
		bool				expanded;
		int					hoverIndex;
		bool				pressed;
		BArray<IMenuItem>	items;
		BSize				contentSize;
	};
}

#endif